import JQuery from 'jquery';
let carousel = {
    setAttribute: function(element) {
        if (element.component === 'CarouselText') {
            this.setValue(this.getMarqueeSpeedName(), element.attribute.scrollamount);
        }
    },
    setMarqueeSpeed: function(element, value, updateInput = true) {
        element.attribute.scrollamount = value;
        updateInput && this.setValue(this.getMarqueeSpeedName(), value);
    },
    setValue: function(id, value) {
        let obj = JQuery('#' + id);
        obj.val(value);
    },
    getMarqueeSpeedName: function() {
        return window.getRootName() + 'ATTRIBUTE_SCROLLAMOUNT';
    },
    setMarqueeDirection: function(element, value) {
        element.attribute.direction = value;
    }
};
export default carousel;
